package com.xyy.saas.payment.adpater.xydLoan.core.req;

import com.xyy.saas.payment.adpater.xydLoan.core.dto.XydRepaymentPlanDto;
import lombok.Data;
import org.apache.commons.lang3.StringUtils;

import java.util.List;

/**
 * @author wangzeqi
 */
@Data
public class XydNotifyLoanResultReq {

    private String channelTradeNo;
    private String creditRate;
    private String interest;
    private String loanAmount;
    private Integer loanLimit;

    /**
     * PROCCESSING:提交放款
     * FAILED:放款取消（终态）
     * SUCCESSED:放款成功（终态）
     * @see com.xyy.saas.payment.adpater.xydLoan.core.enums.XydLoanResultStatus
     */
    private String loanStatus;

    /**
     * 起息日
     * yyyy-MM-dd
     */
    private String loanTime;

    /**
     * 支付时间
     * yyyy-MM-dd HH:mm:ss
     */
    private String payTime;
    private List<XydRepaymentPlanDto> plans;
    private String serviceCharge;
    private String thirdOrderNo;
    private String outerOrderNo;
    private String xydLoanNo;
    private String unpaidPrincipal;
    private String repaymentMode;

    public boolean checkParam() {
        if (StringUtils.isEmpty(thirdOrderNo)
                ||StringUtils.isEmpty(loanAmount)) {
            return false;
        }
        return true;
    }
}
